@model BTCPayServer.Controllers.UIManageController.AuthorizeApiKeysViewModel

@{
    var displayName = Model.ApplicationName ?? Model.ApplicationIdentifier;
    ViewData.SetTitle($"Authorize {displayName ?? "Application"}");
    Layout = "_LayoutWizard";
}

@section PageFootContent {
    <script>
        delegate('click', '#back', () => { history.back() });
    </script>
}

<form method="post" asp-controller="UIManage" asp-action="AuthorizeAPIKey">
    <input type="hidden" asp-for="ApplicationName" value="@Model.ApplicationName"/>
    <input type="hidden" asp-for="ApplicationIdentifier" value="@Model.ApplicationIdentifier"/>
    <input type="hidden" asp-for="ApiKey" value="@Model.ApiKey"/>
    <input type="hidden" asp-for="Strict" value="@Model.Strict"/>
    <input type="hidden" asp-for="RedirectUrl" value="@Model.RedirectUrl"/>
    <input type="hidden" asp-for="Permissions" value="@Model.Permissions"/>
    <input type="hidden" asp-for="SelectiveStores" value="@Model.SelectiveStores"/>
    <header class="text-center">
        <h1>@ViewData["Title"]</h1>
        <p class="lead text-secondary mt-3">Are you sure about exposing your API Key to @displayName?</p>
    </header>
    <p>
        You've previously generated the API Key <code>@Model.ApiKey</code> specifically for
        <strong>@displayName</strong> with the URL <code>@Model.RedirectUrl</code>.
    </p>
    <div class="d-flex gap-3">
        <button class="btn btn-primary" name="command" id="continue" type="submit" value="Confirm" text-translate="true">Authorize app</button>
        <button class="btn btn-secondary" name="command" id="back" type="button" text-translate="true">Cancel</button>
    </div>
</form>
